package locations.actions;
import javax.servlet.http.HttpServletRequest;

import locations.dao.DAOFactory;
import locations.dao.PacientDAO;

import org.apache.struts2.interceptor.ServletRequestAware;

import com.opensymphony.xwork2.ActionSupport;



public class DeletePacientAction extends ActionSupport implements ServletRequestAware  {
	
		private static final long serialVersionUID = -8124967730231198191L;
		
		private HttpServletRequest request; 
		
		public String execute(){
			Long id = Long.parseLong(this.getRequest().getParameter("id"));
			PacientDAO dao = DAOFactory.getPacientDAO();
			dao.delete(id);
			return SUCCESS;
		}

		public HttpServletRequest getRequest() {
			return request;
		}

		@Override
		public void setServletRequest(HttpServletRequest request) {
			this.request = request;
			
		}
}